package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingClassesStudentsMapper;
import com.ruoyi.teaching.domain.TeachingClassesStudents;
import com.ruoyi.teaching.service.ITeachingClassesStudentsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 班级学员Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-18
 */
@Service
public class TeachingClassesStudentsServiceImpl implements ITeachingClassesStudentsService 
{
    @Autowired
    private TeachingClassesStudentsMapper teachingClassesStudentsMapper;

    /**
     * 查询班级学员
     * 
     * @param classStudentId 班级学员主键
     * @return 班级学员
     */
    @Override
    public TeachingClassesStudents selectTeachingClassesStudentsByClassStudentId(Long classStudentId)
    {
        return teachingClassesStudentsMapper.selectTeachingClassesStudentsByClassStudentId(classStudentId);
    }

    /**
     * 查询班级学员列表
     * 
     * @param teachingClassesStudents 班级学员
     * @return 班级学员
     */
    @Override
    public List<TeachingClassesStudents> selectTeachingClassesStudentsList(TeachingClassesStudents teachingClassesStudents)
    {
        return teachingClassesStudentsMapper.selectTeachingClassesStudentsList(teachingClassesStudents);
    }

    /**
     * 新增班级学员
     * 
     * @param teachingClassesStudents 班级学员
     * @return 结果
     */
    @Override
    public int insertTeachingClassesStudents(TeachingClassesStudents teachingClassesStudents)
    {
        teachingClassesStudents.setCreateTime(DateUtils.getNowDate());
        return teachingClassesStudentsMapper.insertTeachingClassesStudents(teachingClassesStudents);
    }

    /**
     * 修改班级学员
     * 
     * @param teachingClassesStudents 班级学员
     * @return 结果
     */
    @Override
    public int updateTeachingClassesStudents(TeachingClassesStudents teachingClassesStudents)
    {
        return teachingClassesStudentsMapper.updateTeachingClassesStudents(teachingClassesStudents);
    }

    /**
     * 批量删除班级学员
     * 
     * @param classStudentIds 需要删除的班级学员主键
     * @return 结果
     */
    @Override
    public int deleteTeachingClassesStudentsByClassStudentIds(String classStudentIds)
    {
        return teachingClassesStudentsMapper.deleteTeachingClassesStudentsByClassStudentIds(Convert.toStrArray(classStudentIds));
    }

    /**
     * 删除班级学员信息
     * 
     * @param classStudentId 班级学员主键
     * @return 结果
     */
    @Override
    public int deleteTeachingClassesStudentsByClassStudentId(Long classStudentId)
    {
        return teachingClassesStudentsMapper.deleteTeachingClassesStudentsByClassStudentId(classStudentId);
    }

    /**
     * 查询班级学员信息
     *
     * @param classId
     * @param studentId
     * @return 班级学员
     */
    @Override
    public TeachingClassesStudents selectTeachingClassesStudentsByClassIdAndStudentId(Long classId, Long studentId){
        return teachingClassesStudentsMapper.selectTeachingClassesStudentsByClassIdAndStudentId(classId, studentId);
    }
}
